{% extends "base.volt" %}

{% block pageHeader %}

    <style>
        .tabs { display: none;}
        .checkbox-inline+.checkbox-inline{ margin-right: 10px;margin-left: 0;}
    </style>
    
{% endblock %}

{% block pageFooter%}
    <script type="text/javascript">
        var domainPic = '{{ this.di.get('appConfig').application.domainPic }}';
        var urlEditorPT = '{{ url.get('tools/editorPT') }}';
        var urlList = '{{ url.get('activity/list',['activity_state':0]) }}';
    </script>

    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.config.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.all.min.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/addCustomizeButton.js", false) }}
    {{ javascript_include("/assets/manage/js/activity/add.js", false) }}
{% endblock %}

{% block content %}
    {{ partial("module/left_activity") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>活动管理</li>
            <li class="active">添加活动</li>
        </ol>
        	<form id="form_add"  class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data">
            <input type="hidden" name="callback" value="parent.setFormResult">
            <input type="hidden" name="city_id" value="{{ filterCity }}">  
            <input type="hidden" name="posion" value="{{ posion_banner }}">                                                
            
            <div class="form-group">
                <label for="activity_title" class="col-xs-2 control-label">标题</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control" id="activity_title" name="activity_title" data-rule="required;length[~20]">
                </div>
            </div>
            
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">封面</label>
                <div class="col-xs-9">                 
                    <input type="file" class="form-control" id="activity_cover" name="activity_cover" data-rule="required;">
                    <p id="imgInfo" class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：710X300px</p>                    
                </div>
            </div>
            <div class="form-group">
                <label for="activity_title" class="col-xs-2 control-label">浏览量</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control" id="views" name="views" data-rule="integer[+0]">
                </div>
            </div>
            <div class="form-group">
            	<label for="bp_is_sell" class="col-xs-2 control-label">城市</label>
            	<div class="col-xs-9">
                    <label class="checkbox-inline">
                        <input type="checkbox" name="city[]" id="cityAll" value="0" data-rule="checked;"> 全国
                    </label>
                    {% for oc in openCity %}
                    <label class="checkbox-inline">
                        <input type="checkbox" name="city[]" id="city" value="{{ oc.city_id }}"> {{ oc.city_name|e }}
                    </label>
                    {% endfor %}
            	</div>
        	</div>
            
            <div class="form-group">
                <label for="activity_intro" class="col-xs-2 control-label">活动介绍</label>
                <div class="col-xs-9">
                	<input id="intro1" name="activity_type" type="radio" value="1" checked="checked">图文介绍
                    <input id="intro2" name="activity_type" type="radio" value="2" >外链地址
                </div>
                
                <div id="intro11" class="col-xs-9">		    
    				<textarea id="editor" style="width:600px;height:300px;" name="activity_intro" data-rule="required;"></textarea>
				</div>               
            </div>
            
            
            <div id="intro22" class="form-group" style="display:none">
                <label for="out_link" class="col-xs-2 control-label">外链地址</label>
                <div class="col-xs-5">
                    <input type="text" class="form-control" value="" id="out_link" name="out_link" data-rule="required;">
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12 text-center">
                    <button id="btn_save" type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                </div>
            </div>
        </form>

    </div>
    
    
    
{% endblock %}